# Maintainer: Andy Postnikov <apostnikov@gmail.com>
pkgname=py3-spin
_pkgname=spin
pkgver=0.8
pkgrel=0
pkgdesc="Developer tool for scientific Python libraries"
url="https://pypi.org/project/spin/"
arch="noarch"
license="BSD-3-Clause"
depends="python3"
makedepends="py3-setuptools py3-gpep517 py3-wheel"
checkdepends="py3-pytest py3-click"
subpackages="$pkgname-pyc"
source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz"
builddir="$srcdir/$_pkgname-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" .dist/*.whl
}

sha512sums="
b8755f692b484b66b445d8e1405946182137c5f176f402a99fffb12883896cce90cd0aed7504dc014b705861b96ca523c0ce87585d16707ba5e49cdd00b40284  spin-0.8.tar.gz
"
